package cn.dlc.com;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.test.context.junit4.SpringRunner;

import javax.sound.midi.Soundbank;

/**
 * @author 邓立川
 * @date 2021/11/21 19:07
 * @desc 当前类的描述信息
 */
@RunWith(SpringRunner.class)
public class Demo01 {

    @Test
    public void test1(){
        String jiamihou = BCrypt.hashpw("secret", BCrypt.gensalt());
        System.out.println(jiamihou);
        // 校验密码
        boolean checkpw = BCrypt.checkpw("secret", jiamihou);
        System.out.println("是否相同" + checkpw);

    }
}
